﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace _3D_Game2
{
    class Shots : BasicModel
    {
       Matrix rotation = Matrix.Identity;
       Matrix Scale = Matrix.Identity;
        Vector3 direction;
        Vector3 myposition;
        float angle = MathHelper.Pi;
        float speed = 3.0f;

        public Shots(Model m, Vector3 Position, Vector3 Direction)
            : base(m)
        {
            world = Matrix.CreateTranslation(Position);
            direction = Direction;
            myposition = Position;
            Scale= Matrix.CreateScale(10);
            //world *= Matrix.CreateRotationX(MathHelper.Pi);
        }

       
        public override void Update()
        {
            
           // myposition.Z -= speed;
            //angle = MathHelper.Pi;
            //world =Scale * Matrix.CreateRotationX(angle) * Matrix.CreateTranslation(myposition);
            // world = Scale * Matrix.CreateRotationX(angle) * Matrix.CreateTranslation(direction);
           // rotation *= Matrix.CreateFromYawPitchRoll(0, 0, 0);
            Scale = Matrix.CreateScale(10.0f);
            world *=   Matrix.CreateTranslation(direction);
           // Matrix.create

        }

        public Vector3 getShotDirection()
        {
            return direction;
        }
        public override Matrix GetWorld()
        {
            return Scale * rotation * world;
        }
    }
}
